package com.bcgtgjyb.huanwen.customview.mylibrary.tool;

import com.bcgtgjyb.huanwen.customview.mylibrary.DataAnimatorValue;

import ohos.agp.animation.Animator;

/**
 * BWValueAnimator 类
 *
 * @since 2016-03-01
 */
public class BWValueAnimator {
    /**
     * getValueAnimator 方法
     *
     * @param param 停止
     * @param time 时间
     * @return 0
     */
    public static DataAnimatorValue getValueAnimator(float param, int time) {
        DataAnimatorValue valueX = new DataAnimatorValue();
        valueX.setCurveType(Animator.CurveType.LINEAR);
        valueX.setDuration(time);
        valueX.setStart(0);
        valueX.setEnd(param);
        return valueX;
    }

    /**
     *
     * getValueAnimator 方法
     *
     * @param start 开始
     * @param end 结束
     * @param time 时间
     * @return 0
     */
    public static DataAnimatorValue getValueAnimator(float start, float end, int time) {
        DataAnimatorValue valueX = new DataAnimatorValue();
        valueX.setCurveType(Animator.CurveType.LINEAR);
        valueX.setDuration(time);
        valueX.setStart(start);
        valueX.setEnd(end);
        return valueX;
    }
}
